<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Merchant</title>
<link rel="stylesheet" href="css/dishes-body.css" type="text/css" />
<link rel="stylesheet" href="css/dishes-nav.css" type="text/css" />
<link rel="stylesheet" href="css/dishes-main.css" type="text/css" />
</head>
<body>


	<div id="dishes-header" class="header">
		<img alt="" src="ImageLoader?path=${sessionScope.loginToken.imageUrl}"
			width="60px" height="60px">
		${sessionScope.loginToken.mName}&nbsp;&nbsp;
		review:${MType}&nbsp;&nbsp; status:${sessionScope.mstatus} <br> <a
			href="LogoutServlet" style="color: blue;">logout</a>
	</div>

	<div align="center">
		<h1>Dishes</h1>
	</div>



	<!-- 	<div align="center"> -->
	<!-- 		<select onchange="jump(this.value)"> -->
	<!-- 			<!-- 		<select name="type" onchange="document.getElementById('selectTypeForm').submit();"> -->
	<%-- 			<c:forEach items="${sessionScope.tlists}" var="dishType"> --%>
	<%-- 				<a>${sessionScope.pid}</a> --%>
	<%-- 				<c:choose> --%>
	<%-- 					<c:when test="${dishType.pId==sessionScope.dType}"> --%>
	<%-- 						<option value="${dishType.pId}" selected="selected">${dishType.pname}</option> --%>
	<%-- 					</c:when> --%>
	<%-- 					<c:otherwise> --%>
	<%-- 						<option value="${dishType.pId}">${dishType.pname}</option> --%>
	<%-- 					</c:otherwise> --%>
	<%-- 				</c:choose> --%>
	<%-- 			</c:forEach> --%>
	<!-- 		</select> -->

	<div id="dishes-nav" class="nav">
		<h3>Dish Type</h3>
		<ul>
			<c:forEach items="${sessionScope.tlists}" var="dishType">
				<c:choose>

					<c:when test="${dishType.pId==sessionScope.dType}">

						<li><a href="ListDishServlet?dType=${dishType.pId}"
							style="color: blue;">${dishType.pname}</a></li>
					</c:when>
					<c:otherwise>
						<li><a href="ListDishServlet?dType=${dishType.pId}">${dishType.pname}</a></li>
					</c:otherwise>
				</c:choose>
			</c:forEach>
		</ul>
	</div>








	<div id="main-farme" class="main">


		<table class="table table-hover">
			<thead>
				<tr>
					<th>Image</th>
					<th>Name</th>
					<th>Price($)</th>
					<th>Operation</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${dishes}" var="dish">
					<tr>
						<td><img src="ImageLoader?path=${dish.dImageURL}" height="80"
							width="80"></td>
						<td>${dish.dName}</td>
						<td>${dish.dPrice}</td>
						<td><a href="DeleteDishServlet?dId=${dish.dId}">Delete</a> <a
							href="QueryDishServlet?dId=${dish.dId}">Update</a></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<div id="addDish" class="addDish" style="margin : 0 auto; width : 20%; ">
			<a href="add_dish.jsp" style="font-size: 40px;" >Add Dish</a>
		</div>
	</div>








	<div >
		
	</div>

</body>
</html>